<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/jquery-3.6.0.js"></script>
    <style>
        .h5 {
            color: red;
        }
    </style>
</head>

<body>
    <h1>改标签体</h1>
    <h1>该属性</h1>
    <h5 asd="123">修改我的内容</h5>
    <img src="../images/account.png" alt="" price="6000">
    <ul>
        <li>aa</li>
        <li>aa</li>
        <li>aa</li>
        <li>aa</li>
        <li>aa</li>
        <li>aa</li>
    </ul>
    <script>
        window.onload = function () {
            var shu
            var h5 = document.querySelectorAll("li");
            for (let i in h5) {
                shu = null;
                shu = Math.ceil(Math.random() * 1000);
                h5[i].setAttribute("price", shu);
                if (i % 2 != 0) {
                    h5[i].innerHTML = "bbb";
                } else {
                    h5[i].style.background = "yellow";
                }
            }
            // $("li:odd").css("backgroundColor", "yellow");
            // $("li:even").css("backgroundColor", "red");
        }
    </script>
</body>

</html>